SetItem
SetItem
Change the text of a menu item void SetItem(theMenu, theItem, itemString ); MenuHandle theMenu ; handle of menu containing item to change short theItem ; ID, within theMenu, of item to change
Str255 itemString ; text to use; meta characters NOT interpreted SetItem is typically used to toggle the meaning of a menu item; e.g., to change between "Show Clipboard" and "Hide Clipboard". It stores the text of an menu
item without interpreting meta characters.
theMenu is a handle leading to a variable-length MenuInfo structure. It is a theItem identifies an item included in theMenu . Items are numbered
sequentially with the topmost item having an ID of 1; the highest ID
itemString is the address of a length-prefixed Pascal-style string containing
the new text for the item. The string may be blank (e.g., "\p "), but
should not be empty.
Note: meta characters are NOT recognized by this function. Item attributes, such as command-keys, check marks, and text style
remain the same as when the item was inserted into the menu.
Notes: This recalculates the menu rectangle automatically (in case the menu
changes width). Example of normal usage:
SetItem( editMenu, UNDO_ITEM, "\pUndo Paste" ); If you use meta characters with this command, they are included in the item
text verbatim. Thus, attributes such as character style and command-key
equivalents are NOT changed by this call.
You can change item attributes via the following commands:
CheckItem Display or remove a check mark to the left of the item. SetItemCmd Set the command-key equivalent for an item; attach a submenu. submenu menu ID (when item cmd is 0x1B).
SetItemStyle Change item's typographic style (bold, underline, etc). EnableItem Change from gray to black / make selec table. DisableItem Change from black to gray / make non-selec table. There is no function to get rid of the command-key associated with an
item. You may do that by deleting the item (DelMenuItem) and installing